﻿<%@ Page Language="C#" MasterPageFile="~/SubForm.Master" AutoEventWireup="true" CodeBehind="UserManagement.aspx.cs"
    Inherits="PreContractWeb.Administration.UserManagement" Title="UserManagement Page"
    EnableEventValidation="false" %>

<%@ Register Src="../UserControl/Pager.ascx" TagName="Pager" TagPrefix="uc1" %>
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="divError" runat="server" style="visibility: hidden">
    </div>
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div id="divConnect" runat="server">
        <script language="javascript">
            function document.onkeydown() {
                var e = event.srcElement;
                if (event.keyCode == 13) {
                    document.all.ctl00$ContentPlaceHolder1$btnSearch.click();
                    return false;
                }
            } 
        </script>
        <table width="95%" border="0" cellpadding="0" cellspacing="0" align="center">
            <tr>
                <td width="100%" height="100%" valign="middle" align="center">
                    <br />
                    <table width="100%" border="0" cellpadding="0" cellspacing="0">
                        <tr>
                            <td class="panel_header">
                                <!--标题-->
                                查询条件 (Search Condition)<!--标题-->
                            </td>
                            <td width="5" rowspan="2" background="../Images/BG-Border-Right.png" valign="top">
                                <img src="../Images/BG-Border-RT.png" border="0" />
                            </td>
                        </tr>
                        <tr>
                            <td class="panel_body">
                                <!--Panel Body-->
                                <table style="width: 100%">
                                    <tr>
                                        <td style="text-align: right;">
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <table style="width: 95%; height: 100%">
                                                <tr>
                                                    <td align="left" style="width: 100px; text-align: left" valign="middle">
                                                        中文名:<br />
                                                        Chinese Name:
                                                    </td>
                                                    <td align="left" style="width: 100px" valign="middle">
                                                        <asp:TextBox ID="txtCName" runat="server" CssClass="cssText" allowempty="true" checkmaster="checkbadwords"></asp:TextBox>
                                                    </td>
                                                    <td align="left" style="width: 100px" valign="middle">
                                                        英文名<br />
                                                        English Name:
                                                    </td>
                                                    <td align="left" style="width: 100px" valign="middle">
                                                        <asp:TextBox ID="txtEName" runat="server" CssClass="cssText" allowempty="true" checkmaster="checkbadwords"></asp:TextBox>
                                                    </td>
                                                    <td align="left" style="width: 100px" valign="middle">
                                                        AD账号:<br />
                                                        AD Account:
                                                    </td>
                                                    <td align="left" style="width: 100px" valign="middle">
                                                        <asp:TextBox ID="txtCIL" runat="server" CssClass="cssText" allowempty="true" checkmaster="checkbadwords"></asp:TextBox>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td align="left" style="width: 100px; text-align: left" valign="middle">
                                                        公司:<br />
                                                        Company:
                                                    </td>
                                                    <td align="left" style="width: 100px" valign="middle">
                                                        <asp:TextBox ID="txtCompany" runat="server" CssClass="cssText" allowempty="true"
                                                            checkmaster="checkbadwords"></asp:TextBox>
                                                    </td>
                                                    <td align="left" style="width: 100px" valign="middle">
                                                        职位:<br />
                                                        Title:
                                                    </td>
                                                    <td align="left" valign="middle" colspan="3">
                                                        <asp:TextBox ID="txtTitle" runat="server" CssClass="cssText" allowempty="true" Width="95%"
                                                            checkmaster="checkbadwords"></asp:TextBox>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td align="left" style="width: 100px; text-align: left" valign="middle">
                                                        工号:<br />
                                                        Badge:
                                                    </td>
                                                    <td align="left" style="width: 100px" valign="middle">
                                                        <asp:TextBox ID="txtBadge" runat="server" allowempty="true" CssClass="cssText" checkmaster="checkbadwords"></asp:TextBox>
                                                    </td>
                                                    <td align="left" style="width: 100px" valign="middle">
                                                        电话:<br />
                                                        Phone:
                                                    </td>
                                                    <td align="left" style="width: 100px" valign="middle">
                                                        <asp:TextBox ID="txtPhone" runat="server" allowempty="true" CssClass="cssText" checkmaster="checkbadwords"></asp:TextBox>
                                                    </td>
                                                    <td align="left" style="width: 100px" valign="middle">
                                                    </td>
                                                    <td align="left" valign="middle">
                                                        &nbsp;
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td align="left" style="width: 100px; text-align: left" valign="middle">
                                                        BD:
                                                    </td>
                                                    <td align="left" style="width: 100px" valign="middle">
                                                        <asp:DropDownList ID="BDDropDownList" runat="server">
                                                        </asp:DropDownList>
                                                    </td>
                                                    <td align="left" style="width: 100px" valign="middle">
                                                        CAT:
                                                    </td>
                                                    <td align="left" style="width: 100px" valign="middle">
                                                        <asp:DropDownList ID="dpCAT" runat="server">
                                                        </asp:DropDownList>
                                                    </td>
                                                    <td align="left" style="width: 100px" valign="middle">
                                                        省份:
                                                        <br />
                                                        Province:
                                                    </td>
                                                    <td align="left" style="width: 100px" valign="middle">
                                                        <asp:DropDownList ID="dpProvinces" runat="server">
                                                        </asp:DropDownList>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td align="left" style="width: 100px; text-align: left" valign="middle">
                                                        UserRole:<br />
                                                        角色名:
                                                    </td>
                                                    <td align="left" style="width: 100px" valign="middle">
                                                        <asp:DropDownList ID="dpRoles" runat="server">
                                                        </asp:DropDownList>
                                                    </td>
                                                    <td align="left" style="width: 100px" valign="middle">
                                                        是否可用:<br />
                                                        Active:
                                                    </td>
                                                    <td align="left" style="width: 100px" valign="middle">
                                                        <asp:CheckBox ID="chkActive" runat="server" Checked="True" />
                                                    </td>
                                                    <td align="left" style="width: 100px" valign="middle">
                                                    </td>
                                                    <td align="left" valign="middle">
                                                        <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                                                            <ContentTemplate>
                                                                <asp:Button ID="btnSearch" OnClick="btnSearch_Click" runat="server" Text="查询 (Search)"
                                                                    CssClass="bgButton" ToolTip="查询"></asp:Button>
                                                            </ContentTemplate>
                                                        </asp:UpdatePanel>
                                                        &nbsp;
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="">
                                            <table width="95%" border="0" cellpadding="0" cellspacing="0">
                                                <tr>
                                                    <td align="cneter" valign="middle" style="border-top: 1px; border-top-color: #BBBBBB;
                                                        border-top-style: dashed; height: 100%">
                                                        <br />
                                                        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                                            <ContentTemplate>
                                                                <script language="javascript" type="text/javascript">
                                                                    function ShowPage(id) {
                                                                        var arg = null;

                                                                        var top = (screen.height - 650) / 2;
                                                                        var left = (screen.width - 800) / 2;

                                                                        arg = window.showModalDialog('EditUser.aspx?id=' + id, '', 'dialogHeight:650px;dialogWidth:880px;dialogTop:' + top + ';dialogLeft:' + left + ';center:Yes;scroll:yes;hidden;resizable:no;status:no;');

                                                                        if (arg != null) {
                                                                            document.getElementById('<%=returnvalue.ClientID%>').value = arg[0];
                                                                        }
                                                                    }
  
                                                                </script>
                                                                <div style="overflow: auto" id="divReport">
                                                                    <input id="returnvalue" type="hidden" name="returnvalue" runat="server" />
                                                                    <asp:GridView ID="gvEmployee" runat="server" Width="98%" PageSize="20" OnRowDataBound="gvEmployee_RowDataBound"
                                                                        DataKeyNames="EmployeeID" AutoGenerateColumns="False" AllowPaging="True">
                                                                        <PagerSettings Visible="False"></PagerSettings>
                                                                        <EmptyDataTemplate>
                                                                            <table width="100%" border="0" cellpadding="0" cellspacing="0">
                                                                                <tr>
                                                                                    <td class="panel_header">
                                                                                        <!--标题-->
                                                                                        没有数据(No Data).
                                                                                        <!--标题-->
                                                                                    </td>
                                                                                </tr>
                                                                            </table>
                                                                        </EmptyDataTemplate>
                                                                        <Columns>
                                                                            <asp:BoundField DataField="CILAccount" HeaderText="CIL账号"></asp:BoundField>
                                                                            <asp:BoundField HtmlEncode="False" DataField="Badge" HeaderText="工号&lt;br/&gt;Badge">
                                                                            </asp:BoundField>
                                                                            <asp:BoundField HtmlEncode="False" DataField="ADAccount" HeaderText="AD账号&lt;br /&gt;ADAccount">
                                                                                <ItemStyle HorizontalAlign="Center"></ItemStyle>
                                                                            </asp:BoundField>
                                                                            <asp:BoundField HtmlEncode="False" DataField="CName" HeaderText="中文名&lt;br /&gt;ChineseName">
                                                                                <ItemStyle HorizontalAlign="Center"></ItemStyle>
                                                                            </asp:BoundField>
                                                                            <asp:BoundField HtmlEncode="False" DataField="EName" HeaderText="英文名&lt;br /&gt;EnglishName">
                                                                                <ItemStyle HorizontalAlign="Center"></ItemStyle>
                                                                            </asp:BoundField>
                                                                            <asp:BoundField HtmlEncode="False" DataField="Company" HeaderText="公司&lt;br /&gt;Company">
                                                                            </asp:BoundField>
                                                                            <asp:BoundField HtmlEncode="False" DataField="Title" HeaderText="职位&lt;br /&gt;Title">
                                                                            </asp:BoundField>
                                                                            <asp:BoundField HtmlEncode="False" DataField="BD" HeaderText="部门&lt;br/&gt;BD">
                                                                                <ItemStyle HorizontalAlign="Center" Width="40px"></ItemStyle>
                                                                            </asp:BoundField>
                                                                            <asp:BoundField HtmlEncode="False" DataField="Email" HeaderText="邮箱&lt;br /&gt;E-mail">
                                                                            </asp:BoundField>
                                                                            <asp:BoundField HtmlEncode="False" DataField="Phone" HeaderText="电话&lt;br /&gt;Phone">
                                                                            </asp:BoundField>
                                                                            <asp:CheckBoxField ReadOnly="True" DataField="Active" HeaderText="是否可用&lt;br /&gt;Active">
                                                                                <ItemStyle HorizontalAlign="Center" Width="60px"></ItemStyle>
                                                                            </asp:CheckBoxField>
                                                                            <asp:TemplateField HeaderText="编辑&lt;br /&gt;Edit" ItemStyle-Width="40px">
                                                                                <ItemStyle HorizontalAlign="Center"></ItemStyle>
                                                                                <ItemTemplate>
                                                                                    <asp:ImageButton ID="imgedit" runat="server" ImageUrl="../images/COMEDIT.GIF" ToolTip="编辑用户权限" />
                                                                                </ItemTemplate>
                                                                            </asp:TemplateField>
                                                                        </Columns>
                                                                        <RowStyle Height="20px" CssClass="table_row_1"></RowStyle>
                                                                        <SelectedRowStyle CssClass="SelectedRow"></SelectedRowStyle>
                                                                        <HeaderStyle CssClass="table_header"></HeaderStyle>
                                                                        <AlternatingRowStyle CssClass="table_row_2"></AlternatingRowStyle>
                                                                    </asp:GridView>
                                                                    <uc1:Pager ID="Pager1" runat="server"></uc1:Pager>
                                                                </div>
                                                            </ContentTemplate>
                                                        </asp:UpdatePanel>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                        </td>
                                    </tr>
                                </table>
                                <!---->
                            </td>
                        </tr>
                        <tr>
                            <td height="5" background="../Images/BG-Border-Bottom.png" align="left">
                                <img src="../Images/BG-Border-LB.png" border="0" />
                            </td>
                            <td width="5" height="5" background="../Images/BG-Border-RB.png">
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </div>
    <script language="javascript">
        window.attachEvent("onresize", resizeFunc1);
        resizeFunc1();
        function resizeFunc1() {
            var parentWin = window.parent;
            if (parentWin != null) {
                var ofrm = parentWin.document.getElementById("main");
                if (ofrm != null) {
                    var sHeight = ofrm.document.body.offsetHeight;
                    var sWidth = ofrm.document.body.offsetWidth;

                    var divReport = document.getElementById("divReport");
                    if (divReport != null) {
                        divReport.style.width = sWidth - 300;
                        divReport.style.height = sHeight - 380;
                    }
                }
            }
        }    
           
    </script>
</asp:Content>
